---
title: "@unkey/api"
description: "Unkey's API provides programmatic access for all resources within our platform."
---

## SDK Installation

The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.

<CodeGroup>

```bash npm
npm add @unkey/api
```

```bash pnpm
pnpm add @unkey/api
```

```bash bun
bun add @unkey/api
```

```bash yarn
yarn add @unkey/api zod

# Note that Yarn does not install peer dependencies automatically. You will need
# to install zod as shown above.
```

</CodeGroup>

<Note>
  {" "}
  This package is published with CommonJS and ES Modules (ESM) support.
</Note>

## Requirements

For supported JavaScript runtimes, please consult [RUNTIMES.md](https://github.com/unkeyed/sdks/blob/main/api/ts/RUNTIMES.md).

## SDK Example Usage

### Example

```typescript
import { Unkey } from "@unkey/api";

const unkey = new Unkey({
  rootKey: process.env["UNKEY_ROOT_KEY"],
});

async function run() {
  const result = await unkey.apis.createApi({
    name: "payment-service-production",
  });

  console.log(result);
}

run();
```

## Repository

{" "}
<Card
  title="GitHub"
  icon="github"
  href="https://github.com/unkeyed/sdks/blob/main/api/ts/README.md"
  cta="README"
>
  The full autogenerated documentation can be found on GitHub.
</Card>
